"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
require("rxjs/add/operator/map");
var CCRiskControllerService = (function () {
    function CCRiskControllerService(http, env) {
        this.http = http;
        this.env = env;
    }
    CCRiskControllerService.prototype.getRiskCategoryList = function () {
        return this.http.get(this.env.urlPrefix + "/windbell/riskCategories").map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.createRiskCategory = function (riskCategory) {
        return this.http.post(this.env.urlPrefix + "/windbell/createRiskCategory", riskCategory).map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.createRiskSubCategory = function (riskCategoryId, riskSubCategory) {
        return this.http.post(this.env.urlPrefix + "/windbell/createRiskSubCategory", riskSubCategory).map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.createRiskCommonIssue = function (riskSubCategoryId, riskCommonIssue) {
        return this.http.post(this.env.urlPrefix + "/windbell/createRiskCommonIssue", riskCommonIssue).map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.updateRiskCategory = function (riskCategory) {
        return this.http.post(this.env.urlPrefix + "/windbell/updateRiskCategory", riskCategory).map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.updateRiskSubCategory = function (riskSubCategory) {
        return this.http.post(this.env.urlPrefix + "/windbell/updateRiskSubCategory", riskSubCategory).map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.updateCommonIssue = function (riskCommonIssue) {
        return this.http.post(this.env.urlPrefix + "/windbell/updateCommonIssue", riskCommonIssue).map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.deleteRiskCategory = function (riskCategoryId) {
        return this.http.get(this.env.urlPrefix + "/windbell/deleteRiskCategory").map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.deleteRiskSubCategory = function (riskSubCategoryId) {
        return this.http.get(this.env.urlPrefix + "/windbell/deleteRiskSubCategory").map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    CCRiskControllerService.prototype.deleteRiskCommonIssue = function (riskCommonIssueId) {
        return this.http.get(this.env.urlPrefix + "/windbell/deleteRiskCommonIssue").map(function (res) {
            var restResult = res.json();
            return restResult.value;
        });
    };
    return CCRiskControllerService;
}());
CCRiskControllerService = __decorate([
    core_1.Injectable()
], CCRiskControllerService);
exports.CCRiskControllerService = CCRiskControllerService;
